import Router from 'vue-router'

import routes from './routes'
const router = new Router({
  routes,
  mode: 'history',
  // base: '/base/',
  linkActiveClass: 'active-link',
  linkExactActiveClass: 'exact-active-link'
})
export default () => {
  return router
}

router.beforeEach((to, from, next) => {
  //  开始漏油
  // console.log('beforeEach each router')
  next()
  // if (to.fullPath === '/app') {
  //   next({ path: '/login' })
  // } else {
  //   next()
  // }
})

router.beforeResolve((to, from, next) => { //
  // console.log('beforeResolve resolve router')
  next()
})

router.afterEach((to, from) => {
  // console.log('afterEach each router')
})
